package com.example.gulimall.auth.properties;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 *      三方登录配置
 * </p>
 *
 * @author zyred
 * @since v 0.1
 **/
@Setter
@Getter
@ConfigurationProperties(prefix = "third.login.gitee")
public class ThirdLoginProperties {

    private String uri;
    private String path;
    private String grantType;
    private String clientId;
    private String redirectUri;
    private String clientSecret;
    private String userInfos;


    public String getUserInfos() {
        return userInfos;
    }

    public Map<String, String> getParam (String code) {
        Map<String, String> map = new HashMap<>(5);
        map.put("client_id", this.clientId);
        map.put("client_secret", this.clientSecret);
        map.put("grant_type", this.grantType);
        map.put("redirect_uri", this.redirectUri);
        map.put("code", code);
        return map;
    }
}
